THIS KNOWLEDGE BASE HAS BEEN ARCHIVED AND IS NO LONGER BEING UPDATED
Please visit library.nagios.com/docs for the latest and most up-to-date documentation.
Home » Categories » Multiple Categories

Nagios XI - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"

Problem Description

After uploading a plugin (check_apc_pdu_load.sh for example), the following error is produced:

The following error message is produced:

-bash: ./check_apc_pdu_load.sh: /bin/bash^M: bad interpreter: No such file or directory

This is caused by the file being in a "Windows" format instead of a "Unix" format. It has to do with the line endings / carriage returns.

 

Resolving The Problem

To resolve the problem you will convert the file to a Unix format. Execute the following steps from an SSH session as a user with root privileges.

The first step is to install the required package:

RHEL | CentOS | Oracle Linux

yum install -y dos2unix

 

Debian | Ubuntu

apt-get install -y dos2unix

 

The next step is to convert the file to a Unix format:

dos2unix /usr/local/nagios/libexec/check_apc_pdu_load.sh


This will output:

dos2unix: converting file /usr/local/nagios/libexec/check_apc_pdu_load.sh to UNIX format ...

 

After completing these steps the plugin should execute as intended.

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

1 (6)
Article Rating (6 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Display All Scheduled Reports
Viewed 6558 times since Wed, Oct 12, 2016
Nagios XI - Notifications Not Sending In XI 5.3.0
Viewed 6962 times since Tue, Oct 4, 2016
Nagios XI - Apply Configuration Fails - Backend login to the Core Configuration failed
Viewed 28160 times since Tue, Aug 2, 2016
Nagios XI - Core 4 Load Spikes on 1.75 and 7 Hour Intervals
Viewed 6046 times since Mon, Jan 25, 2016
Nagios XI - Scheduled Backups No Longer Working
Viewed 10228 times since Fri, Jun 3, 2016
How To Clear Solaris Service Maintenance Status
Viewed 36553 times since Mon, Mar 6, 2017
NRPE - Agent and Plugin Explained
Viewed 77668 times since Fri, Jul 14, 2017
Nagios XI - Upgrade errors - root.crontab.orig: cannot overwrite existing file
Viewed 5964 times since Tue, Jan 26, 2016
Nagios XI - Common Upgrade Failures And Solutions
Viewed 16531 times since Thu, Jun 29, 2017
Nagios XI - MSSQL Wizards - Adaptive Server connection failed
Viewed 13727 times since Thu, Aug 3, 2017